using System;
using System.Collections.Generic;

[Serializable]
public class ProductSet
{
	public string name = "ProductSet";

	public List<SellectedProduct> products = new List<SellectedProduct>();

	public ProductSet(MarketProductsHierarchy heracity)
	{
	}

	public void addAllSubCategory(MarketProductsHierarchy.MarketCategory category, bool withoutSubCatalog = false)
	{
		if (withoutSubCatalog)
		{
			if (products.Find((SellectedProduct x) => x.category == category.name) == null)
			{
				SellectedProduct sellectedProduct = new SellectedProduct();
				sellectedProduct.path = category.GetPath();
				sellectedProduct.category = category.name;
				sellectedProduct.productId = string.Empty;
				products.Add(sellectedProduct);
			}
			return;
		}
		string subCategory;
		foreach (string subCategory2 in category.subCategories)
		{
			subCategory = subCategory2;
			if (products.Find((SellectedProduct x) => x.category == subCategory) == null)
			{
				SellectedProduct sellectedProduct2 = new SellectedProduct();
				sellectedProduct2.path = category.GetPath() + "/" + subCategory + "/";
				sellectedProduct2.category = subCategory;
				sellectedProduct2.productId = string.Empty;
				products.Add(sellectedProduct2);
			}
		}
	}
}
